<form style="padding:30px;" class="layui-form layui-form-pane operationForm">
    <input type="hidden" value="{$info.id}" name="id" />
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="required-color">*</i>父节点：</label>
        <div class="layui-input-block">
            <select name="parent_id" id="parent_id" lay-filter="parent_id" lay-verify="required" lay-search="" >
                <!--<option value="1">根节点</option>-->
                <option value="">直接选择或搜索选择</option>
                {volist name='tree' id='vo'}
                    <option value="{$vo.id}" {if $info.parent_id == $vo.id} selected=""{/if}> |— {$vo.name}({$vo.code})</option>
                    {volist name='vo["children"]' id='vi'}
                        <option value="{$vi.id}" {if $info.parent_id == $vi.id} selected=""{/if}> |—|— {$vi.name}({$vi.code})</option>
                        {volist name='vi["children"]' id='vj'}
                            <option value="{$vj.id}" {if $info.parent_id == $vj.id} selected=""{/if}> |—|—|— {$vj.name}({$vj.code})</option>
                        {/volist}
                    {/volist}
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="required-color">*</i>名称：</label>
        <div class="layui-input-inline">
            <input type="text" name="name"  placeholder="请输入名称" value="{$info.name}" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">请输入操作的名称</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="required-color">*</i>编码：</label>
        <div class="layui-input-inline">
            <input type="text" name="code"  placeholder="请输入编码" value="{$info.code}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="required-color">*</i>菜单节点：</label>
        <div class="layui-input-block">
            <select name="parent_menu_id" id="parent_menu_id" lay-filter="parent_menu_id" lay-search="" lay-verify="required">
                <!--<option value="1">根节点</option>-->
                <option value="">直接选择或搜索选择</option>
                {volist name='menuTree' id='vo'}
                <option value="{$vo.id}" {if $info.parent_menu_id == $vo.id} selected=""{/if}> |— {$vo.name}({$vo.code})</option>
                {volist name='vo["children"]' id='vi'}
                <option value="{$vi.id}" {if $info.parent_menu_id == $vi.id} selected=""{/if}> |—|— {$vi.name}({$vi.code})</option>
                {volist name='vi["children"]' id='vj'}
                <option value="{$vj.id}" {if $info.parent_menu_id == $vj.id} selected=""{/if}> |—|—|— {$vj.name}({$vj.code})</option>
                {/volist}
                {/volist}
                {/volist}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="required-color">*</i>类型：</label>
        <div class="layui-input-block">
            <!--<input type="radio" name="type" value="m" title="模块" {if $info.type == 'm'} checked=""{/if}>-->
            <input type="radio" name="type" value="c" title="控制器" {if $info.type == 'c'} checked=""{/if}>
            <input type="radio" name="type" value="a" title="方法"  {if !isset($info) || $info.type == 'a'} checked=""{/if} >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><i class="required-color">*</i>权限许可：</label>
        <div class="layui-input-block">
            <input type="radio" name="perm_type" value="1" title="主体权限-在菜单上和权限设置上都显示" {if !isset($info) || $info.perm_type == '1'} checked=""{/if}><br />
            <input type="radio" name="perm_type" value="2" title="半主体权限-只在权限设置上显示" {if $info.perm_type == '2'} checked=""{/if}><br />
            <input type="radio" name="perm_type" value="3" title="关联权限-权限依附于所属的菜单节点" {if $info.perm_type == '3'} checked=""{/if}>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序：</label>
        <div class="layui-input-block">
            {php}
            if($info){
            $sort = $info['sort'];
            }else{
            $sort = 100;
            }
            {/php}
            <input type="text" name="sort" required style="width:60px;"  lay-verify="required" value="{$sort}" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">注意：</label>
        <div class="layui-input-block">
            <div class="layui-form-mid layui-word-aux">1.控制器，如果在菜单上（控制器只能在一级菜单上）显示，就设置为主体权限，否则就设置成关联权限即可，而菜单节点一定要写成和父节点一样即可。</div>
            <div class="layui-form-mid layui-word-aux">2.如果是控制器，code按照正常的大小写写法即可，如果是方法，一定要是小写。</div>
        </div>
    </div>
    {:shopToken()}
</form>
<script>
    layui.use('form', function(){
        layui.form.render();
    });
</script>